package com.satan.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.satan.serlializer.CustomeDateTimeSerializer;
import lombok.Data;

import java.util.Date;

/**
 * @ClassName BaseEntity
 * @Description TODO
 * @date 2022/9/22 21:06
 * @Version 1.0
 */
@Data
public class BaseEntity {
    /**
     * 菜单主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 创建日期
     */
    @JsonSerialize(using = CustomeDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 更新日期
     */
    @JsonSerialize(using = CustomeDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    /**
     * 备注
     */
    private String remark;
}
